<%@ page import="com.ld.businesscard_manage.service.BusinessCardService" %>
<%@ page import="com.ld.businesscard_manage.service.impl.BusinessCardServiceImpl" %>
<%@ page import="com.ld.businesscard_manage.bean.BusinessCard" %>
<%@ page import="com.ld.businesscard_manage.service.UserService" %>
<%@ page import="com.ld.businesscard_manage.service.impl.UserServiceImpl" %>
<%@ page import="com.ld.businesscard_manage.bean.User" %>
<%@ page import="com.ld.businesscard_manage.service.RecyleService" %>
<%@ page import="com.ld.businesscard_manage.service.impl.RecyleServiceImpl" %><%--
  Created by IntelliJ IDEA.
  Business: 刘邓
  Date: 2023-06-10
  Time: 15:25
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>恢复名片</title>
</head>
<body>
<%! private BusinessCardService cardService = new BusinessCardServiceImpl();
private RecyleService recyleService = new RecyleServiceImpl();
%>
<%
    User user = (User) (session.getAttribute("user"));
    int id = Integer.parseInt(request.getParameter("id"));
    BusinessCard card = cardService.getCardById(id);
    int i = cardService.recoverCard(id);
    int j = recyleService.deleteRecyleByCardId(id);
    if(i == 0 || j == 0){
        out.println("<h1>恢复失败</h1>");
    }
    else {
        out.println("<h1>恢复成功</h1>");
    }
    if(user.getStatus() == 1) {
        out.println("<a href='/home/manageCard.jsp'>返回名片管理页面</a>");
    }else {
        out.println("<a href='/home/myCard.jsp'>返回个人名片管理页面</a>");
    }
%>
</body>
</html>
